import request from "../utils/request";


// TODO:从后台获取学生数据
export const getTeacherList = (currentPage:number, pageSize:number) => 
    request<any, any>({
        url: '/teacher/list',
        method: 'get',
        params: {
            currentPage,
            pageSize
        }
    })

    export const searchStudent = (keyword:string, currentPage:number, pageSize:number) =>
        request<any, any>({
            url: '/student/search',
            method: 'get',
            params: {
                keyword,
                currentPage,
                pageSize
            }
        })
    
    export const updateStudent = (student:DBStudent) =>
        request<any, any>({
            url: '/student/update',
            method: 'post',
            data: student
        })
    
    export const addStudent = (stu:DBStudent)=>
        request<any,any>({
            url: '/student/add',
            method: 'post',
            data: stu
        })
    
    export const deleteStudent = (id:number)=>request({
        url: '/student/delete',
        method: 'post',
        data: {id}
    })